package com.mdxx.xczd.ui.model;

import com.mdxx.xczd.api.ApiManage;
import com.mdxx.xczd.base.baserx.RxSchedulers;
import com.mdxx.xczd.bean.GetUserResult;
import com.mdxx.xczd.bean.UserBeanResult;
import com.mdxx.xczd.ui.contract.SelectUserContract;
import com.mdxx.xczd.utils.NetworkUtil;
import com.orhanobut.logger.Logger;
import rx.Observable;

/**
 * Created by MD-02 on 2017/2/6.
 */

public class SelectUserModel implements SelectUserContract.Model {

    @Override
    public Observable<GetUserResult> getUserData() {
        return ApiManage.getInstence()
                .getApiService()
                .getUserList(NetworkUtil.getAndroid_id())
                .compose(RxSchedulers.<GetUserResult>io_main());
    }

    @Override
    public Observable<UserBeanResult> getLoginData(String username, String password) {
        return ApiManage.getInstence()
                .getApiService()
                .login(NetworkUtil.getAndroid_id(), username, username, password)
                .compose(RxSchedulers.<UserBeanResult>io_main());
    }
}
